import Vue from "vue";
import Router from "vue-router";
Vue.use(Router);

export default new Router({
  mode: 'history', // 设置为history模式
  routes: [
    {
      path: "*",
      redirect: "/"
    },
    {
      path: "/",
      name: "PageView",
      component: resolve => require(["@/view/PageView"], resolve),
      children: [
        {
          path: "/",
          name: "home",
          component: resolve => require(["@/view/HomePage"], resolve),
          meta: {
            title: "首页"
          }
        },
        {
          path: "/home",
          name: "home",
          component: resolve => require(["@/view/HomePage"], resolve),
          meta: {
            title: "首页"
          }
        },
        {
          path: "/software",
          name: "software",
          component: resolve => require(["@/view/Software"], resolve),
          meta: {
            title: "智能产品"
          },
          children: [
            {
              path: "/software",
              redirect: "/software/total"
            },
            {
              path: "/software/total",
              name: "software",
              component: resolve => require(["@/view/Software_total"], resolve),
              meta: {
                title: "智能产品丨充电桩"
              }
            },
            {
              path: "/software/smartTown",
              name: "software",
              component: resolve =>
                require(["@/view/Software_smartTown"], resolve),
              meta: {
                title: "智能产品丨交流充电桩"
              }
            },
            {
              path: "/software/bigData",
              name: "software",
              component: resolve =>
                require(["@/view/Software_bigData"], resolve),
              meta: {
                title: "智能产品丨7KW充电桩"
              }
            }
          ]
        },
        {
          path: "/service",
          name: "service",
          component: resolve => require(["@/view/Service"], resolve),
          meta: {
            title: "相关服务"
          }
        },
        {
          path: "/newsinformation",
          name: "newsinformation",
          component: resolve => require(["@/view/NewsInformation"], resolve),
          meta: {
            title: "新闻动态"
          }
        },
        {
          path: "/companyintroduction",
          name: "companyintroduction",
          component: resolve =>
            require(["@/view/CompanyIntroduction"], resolve),
          meta: {
            title: "公司介绍"
          }
        },
        {
          path: "/jobchance",
          name: "jobchance",
          component: resolve => require(["@/view/JobChance"], resolve),
          meta: {
            title: "工作机会"
          }
        },
        {
          path: "/contactus",
          name: "contactus",
          component: resolve => require(["@/view/ContactUs"], resolve),
          meta: {
            title: "联系我们"
          }
        },
        {
          path: "/servicedetail",
          name: "servicedetail",
          component: resolve => require(["@/view/ServiceDetail"], resolve),
          meta: {
            title: "相关服务"
          }
        }
      ]
    }
  ]
});
